/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package battle.ship.model;

import java.util.Objects;

/**
 *
 * @author Carlos
 */
public class Move {
    private Point point;
    private SquareType shotresult;
    
    public Move(int x, int y){
        this.point = new Point(x, y);
    }
    
    public Move (Point point){
        this.point = point;
    }
    
    public Point getPoint(){
        return this.point;
    }
    
    public SquareType getShotResult(){
        return this.shotresult;
    }
    
    @Override
    public String toString(){
        return String.format("Joga no ponto %s com o resultado %s", this.point, this.shotresult);
    }
    
    @Override
    public boolean equals(Object obj){
        if (obj == this)
        {
            return true;
        }
        if (obj == null)
        {
            return false;
        }
        if (obj instanceof Move)
        {
            Move other = (Move)obj;
            return this.point.equals(other.point);
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 31 * hash + Objects.hashCode(this.point);
        return hash;
    }
}
